<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>切换身份</title>
<script src="${ctx}/static/selectWin/userSelector.js"
	type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
		// 身份切换
		var $userSelector = $("#userId").comboselector(
				$.extend(userSelectOpts, {
					url : kl.ctx + "/basic/user/runAsdataGrid"
				}));
	});
	function fn_runAs() {
		var userId = $("#userId").comboselector("getValue");
		$.get(kl.ctx + "/basic/user/runAs?userId=" + userId, function(data) {
			$.messager.show({
				msg : data.msg,
				icon : "info",
				position : "bottomRight"
			});
			top.location.reload(true);
		}, "json")
	}
</script>
</head>
<body>
	<div align="center">
		<div id="p" class="easyui-panel" title="身份切换"
			style="width: 420px; height: 270px; padding: 50px;">

			<div id="dlg" class="easyui-dialog"
				style="width: 250px; height: 150px; padding: 10px 20px"
				data-options="iconCls:'icon-save',resizable:true,modal:true, buttons:[
                    { text: '保存', iconCls: 'icon-ok', handler: function () { fn_runAs(); } },
                    { text: '取消', iconCls:'icon-cancel', handler: function () { $('#dlg').dialog('close'); } }
                ],closed:true">
			</div>
			<form id="fm" method="post">
				<label>选择身份</label> <input id="userId" name="userId"
					class="easyui-validatebox" />
			</form>
			<div align="right">
					<button id="search" type="button" onclick="fn_runAs()" class="btn btn-primary">
					<span class="glyphicon glyphicon-search"></span> 确定
				</button>

			</div>
		</div>
	</div>

</body>
</html>
